package top.abrsm.mapper;

import org.apache.ibatis.annotations.Select;
import top.abrsm.entity.FileEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author WuZH
 * @since 2023-11-18
 */
@Mapper
public interface FileMapper extends BaseMapper<FileEntity> {

    @Select ( value = "<script>SELECT * FROM file_info fi\n" +
            "<trim prefix=\"WHERE\" prefixOverrides=\"and | or\">" +
            "<if test='fileJoinId!=null'> AND fi.fileJoinId=#{fileJoinId} </if>" +
            "<if test='fileJoinType!=null'> AND fi.fileJoinType=#{fileJoinType} </if>" +
            "</trim></script>" )
    List<FileEntity> queryList ( String fileJoinId, Integer fileJoinType );

}
